package cn.cnf.common.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author ZhuMeiYi
 * @date 2021/2/4 21:56
 * @description
 */
public class StatisticsUtil {

    public static Pattern chinese = Pattern.compile("[\\u4e00-\\u9fa5]");

    public static int countChinese(String str) {
        int count = 0;
        Matcher m = chinese.matcher(str);
        while(m.find()){
            count++;
        }
        return count;
    }

}
